Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jun 10, 2014

Fixes #13041.

@alexcrichton
Copy link
Member

Could you add a test to ensure that this doesn't leak memory?

enum Foo { NoDrop, NeedsDrop(Box<int>) }
impl Drop for Foo {
    fn drop(&mut self) {
        *self = NeedsDrop(box 3);
    }
}

@ghost
Copy link
Author

ghost commented Jun 10, 2014

@alexcrichton Good call, this needs more work. :-) What was I thinking? Will reopen.

@ghost ghost closed this Jun 10, 2014
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't ICE when implementing Drop on enums

1 participant